﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Index.Master" AutoEventWireup="true"
    CodeBehind="adKhachHang.aspx.cs" Inherits="EC_Agent.KhachHang" %>

<asp:Content ID="Title" ContentPlaceHolderID="Title" runat="server">
    Quản lý Khách hàng
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Maincontent" runat="server">
    <h1>Quản lý Khách hàng</h1>
    <br />
    <div>
        <asp:GridView ID="gvAGENT" runat="server" AutoGenerateColumns="False" CssClass="grid"
            AlternatingRowStyle-CssClass="gridAltRow" RowStyle-CssClass="gridRow"
            EditRowStyle-CssClass="gridEditRow" OnRowCancelingEdit="gvAGENT_RowCancelingEdit"
            OnRowCommand="gvAGENT_RowCommand" OnRowDeleting="gvAGENT_RowDeleting"
            OnRowEditing="gvAGENT_RowEditing" OnRowUpdating="gvAGENT_RowUpdating" DataKeyNames="MaKhachHang"
            AllowPaging="true" PageSize="15" 
            OnPageIndexChanging="gvAGENT_PageIndexChanging" >
            <Columns>
                <asp:TemplateField HeaderText="Username" HeaderStyle-HorizontalAlign="Left" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <%# Eval("Username")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên Khách hàng" HeaderStyle-HorizontalAlign="Left"
                    ControlStyle-Width="90px">
                    <ItemTemplate>
                        <%# Eval("TenKH")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email" HeaderStyle-HorizontalAlign="Left" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <%# Eval("Email")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Điện thoại" HeaderStyle-HorizontalAlign="Left" ControlStyle-Width="90px">
                    <ItemTemplate>
                        <%# Eval("DienThoai")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Đang hoạt động?">
                    <EditItemTemplate>
                        <asp:CheckBox ID="chkTinhTrang" runat="server" Checked='<%# Eval("TinhTrang") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblTinhTrang" runat="server" Text='<%# (Boolean.Parse(Eval("TinhTrang").ToString())) ? "Có" : "" %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Chi tiết" ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDetail" runat="server" CausesValidation="False" CommandName="Detail"
                            Text="Chi tiết"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Cập nhật" ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
                    <EditItemTemplate>
                        <asp:LinkButton ID="lnkUpdate" runat="server" CausesValidation="True" CommandName="Update"
                            Text="Cập nhật" OnClientClick="return confirm('Bạn có muốn cập nhật hay không?')" ValidationGroup="Update"></asp:LinkButton>
                        <asp:ValidationSummary ID="vsUpdate" runat="server" ShowMessageBox="true" ShowSummary="false"
                            ValidationGroup="Update" Enabled="true" HeaderText="Validation Summary..." />
                        <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="Hủy bỏ"></asp:LinkButton>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="False" CommandName="Update"
                            Text="Cập nhật"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Xóa" ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="Xóa" OnClientClick="return confirm('Bạn có muốn xóa hay không?')"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table class="grid" cellspacing="0" rules="all" border="1" id="gvAGENT" style="border-collapse: collapse;">
                    <tr>
                        <th align="left" scope="col">
                            Username
                        </th>
                        <th align="left" scope="col">
                            Tên Khách hàng
                        </th>
                        <th align="left" scope="col">
                            Email
                        </th>
                        <th align="left" scope="col">
                            Điện thoại
                        </th>  
                        <th align="left" scope="col">
                            Đang được kích hoạt?
                        </th>
                        <th align="left" scope="col">
                            Cập nhật
                        </th>
                        <th scope="col">
                            Xóa
                        </th>
                    </tr>
                    <tr class="gridRow">
                        <td colspan="8">
                            No Records found...
                        </td>
                    </tr>
                    <tr class="gridFooterRow">                    
                        <td>
                            <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenKH" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtDienThoai" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:CheckBox ID="chkTinhTrang" runat="server" />
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="sidecontent" runat="server">
<p class="title_general">
        <b>Menu quản lý</b></p>
    <ul>
        <li class="city_item"><a href="adAdmin.aspx">Quản lý</a></li>
        <li class="city_item"><a href="adNhaCungCap.aspx">Quản lý Nhà cung cấp dịch vụ</a></li>
        <li class="city_item"><a href="adHoaDonGiaoDich.aspx">Quản lý Hóa đơn mua dịch vụ</a></li>
        <li class="city_item"><a href="adGiaBan.aspx">Quản lý Giá bán dịch vụ</a></li>
        <li class="city_item"><a href="adHoaDonNCC.aspx">Quản lý Hóa đơn thanh toán</a></li>
        <li class="city_item"><a href="adThanhToan.aspx">Thanh toán</a></li>
        <li class="city_item select">Quản lý Khách hàng</li>
        <li class="city_item"><a href="adLoaiDV.aspx">Quản lý Loại Dịch vụ</a></li>
        <li class="city_item"><a href="adNhanVien.aspx">Quản lý Nhân viên</a></li>
        <li class="city_item"><a href="adChangePass.aspx">Thay đổi mật khẩu</a></li>
        <li class="city_item"><a href="">Đăng xuất</a></li>
    </ul>
</asp:Content>
